package com.cn.jdia.dc.controller;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cn.jdia.dc.model.Mqconfig;
import com.cn.jdia.dc.service.IMqconfigService;

@Controller
@RequestMapping(value = "/mqconfig")
public class MqConfigController {

	@Resource
	private IMqconfigService mqconfigService;

	@RequestMapping(value = "/insert")
	@ResponseBody
	public String insert(@RequestParam("sname") String sname, @RequestParam("ip") String ip,
			@RequestParam("port") String port, @RequestParam("content") String content,
			@RequestParam("mode") String mode, @RequestParam("mqtype") String mqtype) {

		Mqconfig mqconfig = new Mqconfig();
		mqconfig.setServername(sname);
		mqconfig.setIp(ip);
		mqconfig.setPort(port);
		mqconfig.setMqcontent(content);
		mqconfig.setMode(mode);
		mqconfig.setMqtype(mqtype);

		int ret = mqconfigService.insert(mqconfig);

		return ret + "";
	}
}
